//定义初始状态
let state = {count:0};

function reducer(state,action){
    switch(action.type){
        case 'ADD':
            return {count:state.count+1}
    }
}
function dispatch(action){
    state=reducer(state,action);
}
debugger
dispatch({type:'ADD'});
console.log(state)